package ch.sv7.tool.dbmanager.db.difference;

import ch.sv7.tool.dbmanager.db.ColumnSchema;

public class ColumnDefaultValueDifference extends AbstractColumnDifference {

	private String defaultValue;
	private String actualDefaultValue;
	
	public ColumnDefaultValueDifference( 
			ColumnSchema expectedColumnSchema, ColumnSchema actualColumnSchema,
			String defaultValue,
			String actualDefaultValue
			) {
		super(expectedColumnSchema, actualColumnSchema);
		this.defaultValue = defaultValue;
		this.actualDefaultValue = actualDefaultValue;
	}

	public String getMessage() {
		if (actualDefaultValue == null){
			return super.getMessage() + " has no default value but should be " + defaultValue;			
		} else if (defaultValue == null) {
			return super.getMessage() + " should not have a default value, but has default value " + actualDefaultValue;
		} else {
			return super.getMessage() + " has default value " + actualDefaultValue + " but should be " + defaultValue;
		}
	}

	/**
	 * @return the defaultValue
	 */
	public String getDefaultValue() {
		return defaultValue;
	}

	/**
	 * @return the actualDefaultValue
	 */
	public String getActualDefaultValue() {
		return actualDefaultValue;
	}

	public boolean isBlocker() {
		return false;
	}
		
}
